﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="CricAnswers.aspx.vb" Inherits="CricketForum.CricFixture" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
    <h1>
       Question Details:
    </h1>
    </p>
    <p>
        <asp:DataList ID="DataList1" runat="server" DataSourceID="PlayerDetails" Width="100%">
            <ItemTemplate>
                <table width="100%">
                    <tr>
                        <td>
                            <h4>
                                Question Title :</h4>
                        </td>
                        <td>
                        <b>
                            <%# Eval("QTitle")%> </b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                Question Description :</h4>
                        </td>
                        <td>
                            <%# Eval("QDescription")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                Posted By:</h4>
                        </td>
                        <td>
                            <%# Eval("CreatedBy")%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <h4>
                                Posted Date:</h4>
                        </td>
                        <td>
                            <%# Eval("CreatedDate")%>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
            <FooterStyle />
        </asp:DataList>
    </p>
    <p>
    <h1>
        Answer Details :
    </h1>
    </p>
    <p>
        <asp:GridView ID="gvComments" runat="server" AllowSorting="True" AutoGenerateColumns="False"  DataKeyNames="ID"
            Width="100%" >
            <EmptyDataTemplate>
                No answers to this question.
            </EmptyDataTemplate>
            <HeaderStyle CssClass="H1" />
            <Columns>
            
                <asp:BoundField DataField="ID" HeaderText="Answer ID" Visible="false"   />
                <asp:BoundField DataField="Title" HeaderText="Answer Title" SortExpression="Title" />
                <asp:BoundField DataField="UserAnswers" HeaderText="Answer Details"  SortExpression="UserAnswers" />
                <asp:TemplateField HeaderText="Answered By" SortExpression="CreatedBy">
                    <ItemTemplate>

                      <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "~/Account/UserProfile.aspx?ID=" + Eval("CreatedBy") %>'>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CreatedBy") %>'></asp:Label>
                            </asp:HyperLink>                     
                       
                    </ItemTemplate>
                </asp:TemplateField>
               <asp:BoundField DataField="AnsweredDate" HeaderText="Answer Date" SortExpression="AnsweredDate" />
              
                <asp:TemplateField ShowHeader="True" HeaderText="Like and Unlike" >
                    <ItemTemplate>
               
                       <asp:ImageButton ID="Image3" ImageUrl="~/Pictures/General/like.png" runat="server"  Width="60px" Height="30px" CausesValidation="False"   CommandName="Delete"  Text="Like or Unlike" />
                       
                     <%--<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"   
                            CommandName="Delete"  Text="Like or Unlike"></asp:LinkButton>
                              <asp:Image ID="Image2" ImageUrl="~/Pictures/General/like.png" runat="server"  Width="60px" Height="30px" CausesValidation="False"  />--%>
                  
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:BoundField DataField="Likes" HeaderText="Number Of Likes" />
            </Columns>
        </asp:GridView>
    </p>
    <div>
        <table width="100%">
            <tr>
                <td>
                    <asp:Button ID="btnAddComment" runat="server" Text="Click here to Answer" />
                </td>
            </tr>
        </table>
    </div>
    <asp:SqlDataSource ID="PlayerDetails" runat="server" ConnectionString="<%$ ConnectionStrings:ConnStringWorldsCricket %>"
        ProviderName="<%$ ConnectionStrings:ConnStringWorldsCricket.ProviderName %>"
        SelectCommand="SELECT *  from CricQuestion WHERE (CricQuestion.ID = ?) ">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>